package cpnt.iris
{
	import bean.ItemPropertyBean;
	
	import mx.controls.Label;
	import mx.controls.advancedDataGridClasses.AdvancedDataGridListData;
	import mx.controls.listClasses.BaseListData;

	public class RendererLabel extends Label
	{
		public function RendererLabel()
		{
			super();
		}
		
		private var _dataFields:Array;
		public function set dataFields(data:String):void
		{
			_dataFields = data.split(".");
		}
		
		private var _itemPropertyBean:ItemPropertyBean;
		
		private var _listData:AdvancedDataGridListData;
		override public function set listData(value:BaseListData):void
		{
			_listData = value as AdvancedDataGridListData;
			
			_itemPropertyBean = _listData.item as ItemPropertyBean;

			var temp:Object = _itemPropertyBean;
			for each(var field:String in _dataFields)
				temp = temp[field];
			super.text = temp as String;
		}
		override public function get listData():BaseListData
		{
			return _listData;
		}
	}
}
